package
{
	import flash.utils.ByteArray;
	
	/**
	 * Class for holding pre-defined mazes
	 *
	 * @author JAC
	 */
	public class MazeData
	{
		[Embed(source="mazes/blank.maze",mimeType="application/octet-stream")]
		public static const blank:Class;
		
		[Embed(source="mazes/helmet.maze",mimeType="application/octet-stream")]
		public static const helmet:Class;
		
		[Embed(source="mazes/iconic.maze",mimeType="application/octet-stream")]
		public static const iconic:Class;
		
		[Embed(source="mazes/ghost_face.maze",mimeType="application/octet-stream")]
		public static const ghostface:Class;
		
		[Embed(source="mazes/wave_intro.maze",mimeType="application/octet-stream")]
		public static const wave_intro:Class;
		
		[Embed(source="mazes/starship.maze",mimeType="application/octet-stream")]
		public static const starship:Class;

		[Embed(source="mazes/additional_easy.maze",mimeType="application/octet-stream")]
		public static const additional_easy:Class;
		
		[Embed(source="mazes/additional_exorcist.maze",mimeType="application/octet-stream")]
		public static const additional_exorcist:Class;
		
		
		[Embed(source="mazes/second_wave.maze",mimeType="application/octet-stream")]
		public static const second_wave:Class;
		
		[Embed(source="mazes/long_tunnel.maze",mimeType="application/octet-stream")]
		public static const long_tunnel:Class;
		
		[Embed(source="mazes/jac_maze.maze",mimeType="application/octet-stream")]
		public static const jac_maze:Class;
		
		[Embed(source="mazes/score.maze",mimeType="application/octet-stream")]
		public static const score:Class;
		
		[Embed(source="mazes/select.maze",mimeType="application/octet-stream")]
		public static const select:Class;
		
		[Embed(source="mazes/tutorial.maze",mimeType="application/octet-stream")]
		public static const tutorial:Class;
		
		[Embed(source="mazes/tutorial_1.maze",mimeType="application/octet-stream")]
		public static const tutorial_1:Class;
		
		[Embed(source="mazes/tutorial_2.maze",mimeType="application/octet-stream")]
		public static const tutorial_2:Class;
		
		[Embed(source="mazes/tutorial_3.maze",mimeType="application/octet-stream")]
		public static const tutorial_3:Class;
		
		[Embed(source="mazes/tutorial_4.maze",mimeType="application/octet-stream")]
		public static const tutorial_4:Class;
		
		[Embed(source="mazes/random_0.maze",mimeType="application/octet-stream")]
		public static const random_0:Class;
		
		[Embed(source="mazes/random_1.maze",mimeType="application/octet-stream")]
		public static const random_1:Class;
		
		[Embed(source="mazes/level_1.maze",mimeType="application/octet-stream")]
		public static const level_1:Class;
		
		[Embed(source="mazes/level_2.maze",mimeType="application/octet-stream")]
		public static const level_2:Class;
		
		[Embed(source="mazes/level_3.maze",mimeType="application/octet-stream")]
		public static const level_3:Class;
		
		[Embed(source="mazes/level_4.maze",mimeType="application/octet-stream")]
		public static const level_4:Class;
		
		[Embed(source="mazes/level_5.maze",mimeType="application/octet-stream")]
		public static const level_5:Class;
		
		[Embed(source="mazes/level_6.maze",mimeType="application/octet-stream")]
		public static const level_6:Class;
		
		[Embed(source="mazes/level_7.maze",mimeType="application/octet-stream")]
		public static const level_7:Class;
		
		[Embed(source="mazes/level_8.maze",mimeType="application/octet-stream")]
		public static const level_8:Class;
		
		/**
		 * Embedded text is in ByteArray format. This function does a conversion.
		 *
		 * @param	className	The class that represents the ByteArray. Should come from the constants in this class.
		 *
		 * @return	An Array representation of the given ByteArray class .
		 */
		public static function getArray(className:Class):Array
		{
			var result:Array = new Array();
			var data:ByteArray = new className();
			while (data.bytesAvailable > 0)
			{
				result.push(String.fromCharCode(data.readUnsignedByte()));
				if (data.bytesAvailable > 0)
				{
					data.readUnsignedByte();
				}
			}
			return result;
		}
	}
}